/*
 * @lc app=leetcode.cn id=1033 lang=javascript
 *
 * [1033] 移动石子直到连续
 */

// @lc code=start
/**
 * @param {number} a
 * @param {number} b
 * @param {number} c
 * @return {number[]}
 */
var numMovesStones = function(a, b, c) {
    let arr = [a,b,c].sort((n,m) => n-m)
    let left = arr[1] - arr[0] -1
    let right = arr[2] - arr[1] -1
    let max = left + right
    let min = 0
  
    if (left !== 0 || right !== 0) {
      if (left > 1 && right > 1) {
        min = 2
      } else {
        min = 1
      }
    }
  
    return [min,max]
};//先排序最重要
// @lc code=end

